<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.hh.baseframework.util.statics.SysParam"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ taglib prefix="mytags"  tagdir="/WEB-INF/tags"%>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>登录<%=SysParam.hhSysParam.getSysName() %></title>
<link rel="shortcut icon" href="<%=SysParam.hhSysParam.getSysIcon() %>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/hhcommon/opensource/bootstrap/css/bootstrap.css"
	rel="stylesheet">
<style type="text/css">
body {
	padding-top: 100px;
	padding-bottom: 40px;
	background-color: #f5f5f5;
}

.form-signin {
	max-width: 300px;
	padding: 19px 29px 29px;
	margin: 0 auto 20px;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.form-signin .form-signin-heading,.form-signin .checkbox {
	margin-bottom: 10px;
}

.form-signin input[type="text"],.form-signin input[type="password"] {
	font-size: 16px;
	height: auto;
	margin-bottom: 15px;
	padding: 7px 9px;
}
.overlay {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 10;
	width: 100%;
	height: 100%;
	background-color: #fff;
	filter: alpha(opacity = 40);
	-moz-opacity: 0.4;
	opacity: 0.4;
	z-index: 2000000000001;
}
#loading {
	height: auto;
	position: absolute;
	border: 3px solid #ccc;
	left: 45%;
	top: 40%;
	padding: 2px;
	width : 190px;
	z-index: 2000000000001;
}

#loading .loading-indicator {
	background: white;
	color: #444;
	
	font: bold 12px Helvetica, Arial, sans-serif;
	height: auto;
	margin: 0;
	padding: 10px;
}
</style>
<script type="text/javascript">
if(this.parent!=null&&this.parent.Login!=null){
	this.parent.Login.show({
		jump : false
	});
	this.parent.Doing.hidden(true);
	this.parent.desktoptabs.remove(this.parent.desktoptabs.getActiveTab( ));
}

	function doingHidden(as) {
		if (as) {
			document.getElementById('doing').style.visibility = "hidden";
			document.getElementById('loading').style.visibility = "hidden";
		} else {
			document.getElementById('doing').style.visibility = "visible";
			document.getElementById('loading').style.visibility = "visible";
		}
	}
</script>
</head>
<body>
	<div id="doing" class="overlay"   style="visibility: hidden;">
	</div>
	<div id="loading"  style="visibility: hidden;">
		<div class="loading-indicator">
			<img src="/hhcommon/images/loading/loading.gif" width="16" height="16"
				style="margin-right: 8px; float: left; vertical-align: top;" />正在登录，请稍后......
		</div>
	</div>
	<%
		String name = "";
		String password = "";
		String cookie = "";
		try {
			javax.servlet.http.Cookie[] cookies = request.getCookies();
			if (cookies != null) {
				for (int i = 0; i < cookies.length; i++) {
					if (cookies[i].getName().equals("xtYh.vdlzh")) {
						name = cookies[i].getValue();
					}
					if (cookies[i].getName().equals("xtYh.vmm")) {
						password = cookies[i].getValue();
					}
					if (cookies[i].getName().equals("xtYh.cookie")) {
						cookie = cookies[i].getValue();
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	%>

	<div class="container">
		<form class="form-signin" method="post" action="system-login-login">
			<h2 class="form-signin-heading"><%=SysParam.hhSysParam.getSysName() %></h2>
			<c:if test="${message!=null && message!=''}">
				<div class="alert alert-info" style="max-width: 300px;">
					${message}</div>
			</c:if>
			<input type="hidden" name="type" value="jsp" /> <input type="text"
				class="input-block-level" name="xtYh.vdlzh" value="<%=name%>"
				placeholder="用户名"> <input type="password"
				class="input-block-level" name="xtYh.vmm" value="<%=password%>"
				placeholder="密码"> <label class="checkbox"> <input
				name="cookie" type="checkbox" value="1" <%=cookie%>> 记住我
			</label>
			<button class="btn btn-large btn-primary" type="submit"
				onClick="doingHidden(false);">登录</button>
		</form>
	</div>
</body>
</html>
